﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" AutoEventWireup="true" CodeBehind="Error.aspx.cs" Inherits="Website.Views.Shared.Error" %>

<asp:Content ID="PageTitleContent" ContentPlaceHolderID="PageTitleHolder" runat="server">
    <h2 style="margin-top:25px;">Sorry, an error occurred while processing your request.</h2>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="ContentHolder" runat="server">
    
    <style type="text/css" media="screen">
        #main 
        {
        	margin-bottom: 40px;
        	min-height: 0;
        	width: 100%;
        }
        #main h3
        {
        	margin: 0 0 1em;
        }
        #errorDetail
        {
        	overflow-x:auto; 
        	overflow-y:hidden;
        }
        #errorDetail pre
        {
        	line-height: 1.2em;
        	margin: 15px 0px;
        }
    </style>
    
    <% if (!ViewContext.HttpContext.IsCustomErrorEnabled) { %>
        <h3>Exception details:</h3>
        <div id="errorDetail">
            <%
                Stack<Exception> exceptions = new Stack<Exception>();
                for (Exception ex = ViewData.Model.Exception; ex != null; ex = ex.InnerException) {
                    exceptions.Push(ex);
                }
                foreach (Exception ex in exceptions) {
                    %>
                        <div>
                            <b><%= Html.Encode(ex.GetType().FullName)%></b>: <%= Html.Encode(ex.Message)%>
                        </div>
                        <div>
                            <pre style="font-size: medium;"><%= Html.Encode(ex.StackTrace)%></pre>
                        </div>
                    <%
                }  
            %>
        </div>
    <% } %>
</asp:Content>
